package cn.linkpower.service;


import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

@Service
public class MyService {

    // 具体使用哪个线程池
    @Async("myThreadPoolExecutor")
    public void service1() throws InterruptedException {
        System.out.println("----- service1 start --------"+System.currentTimeMillis());
        TimeUnit.SECONDS.sleep(3);
        System.out.println("----- service1 end --------"+System.currentTimeMillis());
    }
}
